package abstractfactory.creator.abstractorinterface;

import abstractfactory.product.abstracts.Pizza;

/**
 * @ClassName: PizzaStore
 * @Description: 披萨总店（工厂方法）
 * @Date: 2021/1/12 16:42
 * @Author: Song JinGen
 */
public abstract class PizzaStore {
    /**
     * 披萨订单
     * @param type
     * @return
     */
    public Pizza orderPizza(int type){
        Pizza pizza = this.createPizza(type);
        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();
        return pizza;
    }

    /**
     * 制作披萨
     * @param type
     * @return
     */
    protected abstract Pizza createPizza(int type);
}
